package com.hxl.tech.gateway.auth.dto.limitrule;


import com.hxl.tech.gateway.auth.annotate.EnumCheck;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * 限流配置查询 DTO
 * @author soliddq
 * @date 2023-10-16
 */
@Data
public class LimitRuleSaveDTO {

    @ApiModelProperty(value = "名称", name = "rule_name", required = true)
    @NotEmpty
    private String ruleName;

    @ApiModelProperty(value = "描述", name = "rule_desc", required = false)
    private String ruleDesc;

    @ApiModelProperty(value = "应用ID", name = "app_id", required = true)
    @NotEmpty
    private String appId;

    @ApiModelProperty(value = "商户号", name = "merchant_code", required = true)
    @NotEmpty
    private String merchantCode;

    @ApiModelProperty(value = "开放接口名称", name = "api_name", required = true)
    @NotEmpty
    private String apiName;

    @ApiModelProperty(value = "限制请求次数", name = "limit_count", required = true)
    @NotNull
    private Integer limitCount;

    @ApiModelProperty(value = "限制时间单位(秒)", name = "limit_time_unit", required = true)
    @NotEmpty
    @EnumCheck(enumString = "秒|分")
    private String limitTimeUnit;

}
